/*    */ package com.zimbra.cs.account.ldap.upgrade;
/*    */ 
/*    */ import com.zimbra.common.service.ServiceException;
/*    */ import com.zimbra.common.util.Pair;
/*    */ import com.zimbra.common.util.StringUtil;
/*    */ import com.zimbra.cs.account.Config;
/*    */ import com.zimbra.cs.account.ldap.LdapProv;
/*    */ import java.util.HashMap;
/*    */ import java.util.Map;
/*    */ import java.util.Set;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public class BUG_47934
/*    */   extends UpgradeOp
/*    */ {
/*    */   void doUpgrade()
/*    */     throws ServiceException
/*    */   {
/* 33 */     upgradeZimbraGalLdapFilterDef();
/* 34 */     upgradeZimbraGalLdapAttrMap();
/*    */   }
/*    */   
/*    */   void upgradeZimbraGalLdapFilterDef() throws ServiceException {
/* 38 */     Config config = this.prov.getConfig();
/*    */     
/*    */ 
/* 41 */     Pair[] values = { new Pair("zimbraAccounts:(&(|(displayName=*%s*)(cn=*%s*)(sn=*%s*)(gn=*%s*)(mail=*%s*)(zimbraMailDeliveryAddress=*%s*)(zimbraMailAlias=*%s*))(|(objectclass=zimbraAccount)(objectclass=zimbraDistributionList))(!(objectclass=zimbraCalendarResource)))", "zimbraAccounts:(&(|(displayName=*%s*)(cn=*%s*)(sn=*%s*)(gn=*%s*)(zimbraPhoneticFirstName=*%s*)(zimbraPhoneticLastName=*%s*)(mail=*%s*)(zimbraMailDeliveryAddress=*%s*)(zimbraMailAlias=*%s*))(|(objectclass=zimbraAccount)(objectclass=zimbraDistributionList))(!(objectclass=zimbraCalendarResource)))"), new Pair("zimbraAccountAutoComplete:(&(|(displayName=%s*)(cn=%s*)(sn=%s*)(gn=%s*)(mail=%s*)(zimbraMailDeliveryAddress=%s*)(zimbraMailAlias=%s*))(|(objectclass=zimbraAccount)(objectclass=zimbraDistributionList))(!(objectclass=zimbraCalendarResource)))", "zimbraAccountAutoComplete:(&(|(displayName=%s*)(cn=%s*)(sn=%s*)(gn=%s*)(zimbraPhoneticFirstName=%s*)(zimbraPhoneticLastName=%s*)(mail=%s*)(zimbraMailDeliveryAddress=%s*)(zimbraMailAlias=%s*))(|(objectclass=zimbraAccount)(objectclass=zimbraDistributionList))(!(objectclass=zimbraCalendarResource)))"), new Pair("zimbraAccountSync:(&(|(displayName=*%s*)(cn=*%s*)(sn=*%s*)(gn=*%s*)(mail=*%s*)(zimbraMailDeliveryAddress=*%s*)(zimbraMailAlias=*%s*))(|(objectclass=zimbraAccount)(objectclass=zimbraDistributionList))(!(objectclass=zimbraCalendarResource)))", "zimbraAccountSync:(&(|(displayName=*%s*)(cn=*%s*)(sn=*%s*)(gn=*%s*)(zimbraPhoneticFirstName=*%s*)(zimbraPhoneticLastName=*%s*)(mail=*%s*)(zimbraMailDeliveryAddress=*%s*)(zimbraMailAlias=*%s*))(|(objectclass=zimbraAccount)(objectclass=zimbraDistributionList))(!(objectclass=zimbraCalendarResource)))"), new Pair("zimbraAutoComplete:(&(|(displayName=%s*)(cn=%s*)(sn=%s*)(gn=%s*)(mail=%s*)(zimbraMailDeliveryAddress=%s*)(zimbraMailAlias=%s*))(|(objectclass=zimbraAccount)(objectclass=zimbraDistributionList)))", "zimbraAutoComplete:(&(|(displayName=%s*)(cn=%s*)(sn=%s*)(gn=%s*)(zimbraPhoneticFirstName=%s*)(zimbraPhoneticLastName=%s*)(mail=%s*)(zimbraMailDeliveryAddress=%s*)(zimbraMailAlias=%s*))(|(objectclass=zimbraAccount)(objectclass=zimbraDistributionList)))"), new Pair("zimbraSearch:(&(|(displayName=*%s*)(cn=*%s*)(sn=*%s*)(gn=*%s*)(mail=*%s*)(zimbraMailDeliveryAddress=*%s*)(zimbraMailAlias=*%s*))(|(objectclass=zimbraAccount)(objectclass=zimbraDistributionList)))", "zimbraSearch:(&(|(displayName=*%s*)(cn=*%s*)(sn=*%s*)(gn=*%s*)(zimbraPhoneticFirstName=*%s*)(zimbraPhoneticLastName=*%s*)(mail=*%s*)(zimbraMailDeliveryAddress=*%s*)(zimbraMailAlias=*%s*))(|(objectclass=zimbraAccount)(objectclass=zimbraDistributionList)))") };
/*    */     
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/* 64 */     Set<String> curValues = config.getMultiAttrSet("zimbraGalLdapFilterDef");
/*    */     
/* 66 */     Map<String, Object> attrs = new HashMap();
/* 67 */     for (Pair<String, String> change : values) {
/* 68 */       String oldValue = (String)change.getFirst();
/* 69 */       String newValue = (String)change.getSecond();
/*    */       
/* 71 */       if (curValues.contains(oldValue)) {
/* 72 */         StringUtil.addToMultiMap(attrs, "-zimbraGalLdapFilterDef", oldValue);
/* 73 */         StringUtil.addToMultiMap(attrs, "+zimbraGalLdapFilterDef", newValue);
/*    */       }
/*    */     }
/*    */     
/* 77 */     modifyAttrs(config, attrs);
/*    */   }
/*    */   
/*    */   void upgradeZimbraGalLdapAttrMap() throws ServiceException {
/* 81 */     Config config = this.prov.getConfig();
/*    */     
/* 83 */     String[] values = { "zimbraPhoneticCompany,ms-DS-Phonetic-Company-Name=phoneticCompany", "zimbraPhoneticFirstName,ms-DS-Phonetic-First-Name=phoneticFirstName", "zimbraPhoneticLastName,ms-DS-Phonetic-Last-Name=phoneticLastName" };
/*    */     
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/* 89 */     Map<String, Object> attrs = new HashMap();
/* 90 */     attrs.put("+zimbraGalLdapAttrMap", values);
/*    */     
/* 92 */     modifyAttrs(config, attrs);
/*    */   }
/*    */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/account/ldap/upgrade/BUG_47934.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */